<template>
	<view class="u-page">
		<view class="content">
			<view class="success"><image src="../../../static/icon/success.png" mode=""></image></view>
			<view class="title">身份验证通过</view>
			<view class="formdata">
				<view class="listLable">
					<view class="label">姓名</view><view class="name">{{formData.username}}</view>
				</view>
				<view class="listLable">
					<view class="label">身份证号</view><view class="name">{{formData.idCard}}</view>
				</view>
				<view class="listLable">
					<view class="label">签发机关</view><view class="name">{{formData.idTime}}</view>
				</view>
				<view class="listLable">
					<view class="label">有效期</view><view class="name">{{formData.idLssue}}</view>
				</view>
				<view class="sbut">
					<button type="warn" @click="gopage()" v-if="formData.phoneAttestation !=1">下一步</button>
					<button type="warn" @click="gobark()" v-else >返回</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				formData:{
					"username":'-------',
					"idCard":'-------',
					"idTime":'-------',
					"idLssue":'-------'
					
				}
			}
		},
		onLoad() {
			this.users();
		},
		
		methods: {
			//获取用户认证信息
			async users(){
				const user = await this.GQL({
						"operationName": "allSlUsers",
						"query": "query allSlUsers($filter: SlUserFilter) { allSlUsers(filter:$filter) { nodes { uid username idTime idLssue idCard idAttestation phoneAttestation } } }",
						"variables": {"filter": {"uid":{"equalTo":uni.getStorageSync('userData').uid}}}
				})
				
				// console.log('1111',user)
				this.formData = user.data.allSlUsers.nodes[0]
				
			},
			//下一步
			gopage(){
				console.log('1111111')
				uni.navigateTo({
					url:'/pages/project/investment/phonesuccessful'
				})
			},
			//返回
			gobark(){
				uni.navigateBack({
					delta:2
				})
			}
		}
	}
</script>

<style lang="scss">
	.content{
		// margin: 15px;
		background-color: #FFFFFF;
		text-align: center;
		padding: 0 10px;
	}
	.sbut{
		margin-top: 300px;
		
	}
	.success{
		padding-top: 30px;
		image{
			width: 60px;
			height: 60px;
		}
	}
	.title{
		margin: 12px 0 66px 0;
		font-size: 18px;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #161E3E;
		line-height: 16px;
	}
	
	.formdata{
		
		.listLable{
			display: flex;
			height: 30px;
			margin: 10px 0px;
			font-size: 15px;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #161E3E;
			line-height: 16px;
			padding: 0 40px;
		}
		.label{
			width: 100px;
			text-align: left;
		}
		.name{
			font-size: 15px;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #767B8D;
			line-height: 16px;
		}
	}
</style>
